Skip to content

@W-17066806 add guard to CHR function#151

Open
dougdew64 wants to merge 2 commits intosalesforce:mainfrom
dougdew64:u/ddew/W-17066806/add-guard-to-chr-function
Open

@W-17066806 add guard to CHR function#151
dougdew64 wants to merge 2 commits intosalesforce:mainfrom
dougdew64:u/ddew/W-17066806/add-guard-to-chr-function

Conversation

@dougdew64
Copy link
Copy Markdown
Collaborator

Added guard for CHR function so that inputs larger than 1114111 cause error.

Also, commented out some oracle tests, per our goal of focusing this repo on postgres.

@Override
public SQLPair getSQL(FormulaAST node, FormulaContext context, String[] args, String[] guards, TableAliasRegistry registry) {
String guard = SQLPair.generateGuard(guards, args[0] + "<1");
String guard = SQLPair.generateGuard(guards, args[0] + "<1 OR " + args[0] + ">1114111");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can make it safer.
"(" + args[0] + "<1 OR " + args[0] + ">1114111)"

@bairenlong-sfdc
Copy link
Copy Markdown
Collaborator

@dougdew64 Your commit is not signed!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants